package jsyf.oa.service.crm;

import com.alibaba.fastjson.JSON;
import jsyf.oa.dao.crm.EquipmentTypeDao;
import jsyf.oa.entity.crm.EquipmentTypeEntity;
import jsyf.oa.facade.crm.EquipmentTypeFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Administrator on 2017/12/19 0019.
 */
@Service
@Transactional(rollbackFor = Exception.class)
@com.alibaba.dubbo.config.annotation.Service(protocol = {"dubbo"})
public class EquipmentTypeService implements EquipmentTypeFacade {

    @Autowired
    private EquipmentTypeDao dao;


    @Override
    public String save(String jsonData) {
        EquipmentTypeEntity entity = JSON.toJavaObject(JSON.parseObject(jsonData), EquipmentTypeEntity.class);
        dao.add(entity);
        return entity.getId();
    }
}
